package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.Constant;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017-07-26.
 */

public class AllOrderListApi extends BaseApi {
    AllOrderListReq req;
    public AllOrderListApi(String member_id, int page_num, String order_status){
        req=new AllOrderListReq(member_id,page_num,order_status);
    }
    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).orderList(requestBody);
    }
    private class AllOrderListReq{
        private String member_id;
        private int page_num;
        private String order_status;
        private String o2o_flag;
        private String yw_id;

        public AllOrderListReq(String member_id, int page_num,
                                    String order_status) {
            super();
            this.member_id = member_id;
            this.page_num = page_num;
            this.order_status = order_status;
            this.yw_id = Constant.YW_ID;
        }
    }
}
